<?php

namespace App\Containers\AppSection\Ban\Traits;


use App\Containers\AppSection\Ban\UI\API\Transformers\BanTransformer;
use App\Ship\Parents\Models\Model;
use League\Fractal\Resource\Collection;
use League\Fractal\Resource\Item;

trait HasBansTransformer
{
    public function includeBan(Model $t): ?Item
    {
        return $this->nullableItem($t->ban, new BanTransformer);
    }

    public function includeBans(Model $t): ?Collection
    {
        return $this->collection($t->bans, new BanTransformer);
    }
}
